<script setup>
import {ref,onMounted} from "vue"
import axios from "axios"
import {ElMessage} from "element-plus"

let phone = ref('')
let password = ref('')
const login = () => {
    axios.post(`http://127.0.0.1:8000/phone/phone/search/`,{'phone':phone.value,'password':password.value})
    .then(res => {
        console.log(res)
        if(res.data.code == 200){
            ElMessage({message: "登录成功",type:"success"})
        }else{
            ElMessage({message: res.data,type:"error"})
        }
    })
    
   
}   
</script>

<template>
<h1>请输入</h1>
<p>手机号:<el-input v-model="phone" style="width: 240px" placeholder="Please input phone" /></p>
<p>密码:<el-input v-model="password" style="width: 240px" placeholder="Please input phone" /></p>
<el-button type="primary" @click="login">登录</el-button>
</template>

<style scoped>

</style>
